import request from '../../utils/request';
let baseRequest_url = "http://127.0.0.1:4890/portal";
//  --------------------------------------------------------------------------------------------------------------- //
// 通过分类ID获取属性信息
export const findAttributeListPageByClassifyId = query => {
    return request({
        url: baseRequest_url+'/admin/product/attribute/findAttributeListPageByClassifyId/',
        method: 'get',
        params: query,
    });
};
// 通过分类ID获取属性信息
export const findAttributeListByClassifyId = query => {
    return request({
        url: baseRequest_url+'/admin/product/attribute/findAttributeListByClassifyId/'+query,
        method: 'get',
    });
};
// 通过分类ID和商品ID获取属性值信息
export const findAttributesByProductAndClassifyId = query => {
    return request({
        url: baseRequest_url+'/admin/product/attribute/findAttributesByProductAndClassifyId',
        method: 'get',
        params: query,
    });
};
// 通过属性ID获取属性信息
export const findAttributeInfoById = query => {
    return request({
        url: baseRequest_url+'/admin/product/attribute/findAttributeInfoById/' + query,
        method: 'get',
    });
};
// 新增属性
export const addAttribute = data => {
    return request({
        url: baseRequest_url+'/admin/product/attribute/saveAttribute',
        method: 'post',
        data: data
    });
};
// 编辑属性
export const saveAttribute = data => {
    return request({
        url: baseRequest_url+'/admin/product/attribute/saveAttribute',
        method: 'put',
        data: data
    });
};
// 删除属性
export const deleteAttribute = data => {
    return request({
        url: baseRequest_url+'/admin/product/attribute/deleteAttribute/'+data,
        method: 'delete',
    });
};